/**
* This file is part of OntoApplications (project linked with OntoCompoFramework)
*
* Copyright (C) 2011 -  Christian Brel
*
* @author   Main    Christian Brel
**/
package applications.businessdirectory.ui.lib;

import java.awt.Color;

import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;

import org.objectweb.fractal.fraclet.annotations.Component;
import org.objectweb.fractal.fraclet.annotations.Interface;
import org.objectweb.fractal.fraclet.annotations.Requires;

@Component(provides = {@Interface(name = "jPanelItf", signature = org.objectweb.fractal.swing.JPanelItf.class), @Interface(name = "jPanelAttributes", signature = org.objectweb.fractal.swing.JPanelAttributes.class), @Interface(name = "uicontainerservice", signature = ontocompo.api.UIContainerService.class), @Interface(name = "ontocompointrospection", signature = ontocompo.api.OntoCompoIntrospection.class)})
public class MainPane extends JPanel implements /*ContainerService,*/ org.objectweb.fractal.swing.JPanelItf, org.objectweb.fractal.swing.JPanelAttributes, ontocompo.api.UIContainerService, ontocompo.api.OntoCompoIntrospection {

	private String uid;
	private org.objectweb.fractal.api.Component c;
	
	@Requires(name = "formpanel")
	private ontocompo.api.UIContainerService formpanel;
	
	@Requires(name = "visitcardpanel")
	private ontocompo.api.UIContainerService visitcardpanel;
	
	@Requires(name = "postsinfopanel")
	private ontocompo.api.UIContainerService postsinfopanel;
	
	@Requires(name = "assignmentsinfopanel")
	private ontocompo.api.UIContainerService assignmentsinfopanel;
	
	public MainPane() {
		super();
		this.uid = "applications.businessdirectory.ui.lib.MainPane";
		System.out.println(this.toString() + " created");
		
		//this.init();
	}
	
	public void init() {
		this.formpanel.init();
		this.visitcardpanel.init();
		this.postsinfopanel.init();
		this.assignmentsinfopanel.init();
		
		this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		this.setBackground(Color.white);
		
		//System.out.println("OK 1");
		
		this.add(this.formpanel.getComponentItSelf());
		
		//System.out.println("OK 2");
		
		this.add(this.visitcardpanel.getComponentItSelf());
		
		this.add(this.postsinfopanel.getComponentItSelf());
		
		this.add(this.assignmentsinfopanel.getComponentItSelf());
		
		//System.out.println("OK 3");
	}
	
	@Override
	public JComponent getComponentItSelf() {
		// TODO Auto-generated method stub
		return this;
	}

	@Override
	public String getUid() {
		// TODO Auto-generated method stub
		return this.uid;
	}

	@Override
	public void setUid(String uid) {
		// TODO Auto-generated method stub
		this.uid = uid;
	}

	public String toString() {
		return "MainPane";
	}

	@Override
	public org.objectweb.fractal.api.Component getFractalComponent() {
		// TODO Auto-generated method stub
		return this.c;
	}

	@Override
	public void setFractalComponent(org.objectweb.fractal.api.Component c) {
		// TODO Auto-generated method stub
		this.c = c;
	}

	@Override
	public void update(Object o) {
		// TODO Auto-generated method stub
		
	}
}
